1. Field of the Invention
The present invention relates to a robot apparatus that controls a position and an orientation of a robot arm using a visual sensor that is provided at a certain position that remains the same with respect to an installation surface of the robot arm and that performs detection within a detection range including at least part of a range in which the robot arm is movable, and a method for controlling the robot apparatus.
2. Description of the Related Art
Robot apparatuses are widely used in production of industry products. With respect to such robot apparatuses, a system configuration is known in which a robot and detection performed by a visual sensor are combined with each other in order to automatically and accurately pick up and assemble workpieces. The visual sensor here refers to a sensor with which positions and orientations of objects can be detected in two dimensions or three dimensions.
Such a visual sensor may be an optical sensor such as a camera. The positions and orientations of the objects are measured in two dimensions or three dimensions through image processing, such as image recognition, performed on an image captured by the optical sensor. Common single-lens industrial cameras, stereo cameras including a plurality of cameras used for performing three-dimensional measurement on the basis of a particular degree of parallax, three-dimensional measurement sensors in which optical systems that emit a sheet of laser light or pattern light onto objects and cameras are combined with each other, for example, are used as visual sensors. In general, visual sensors used with robots are described using terms such as “vision”, “robot vision”, and “cameras”.
In a robot vision system including a robot apparatus that picks up workpieces, for example, a visual sensor is mounted above a workpiece supply area (a conveyor, a tray, a parts box, or the like). The visual sensor is fixed at a certain position that remains the same with respect to an installation surface of a robot arm independently of the operation of the robot arm. A detection range of the visual sensor includes most (or all) of the work supply area.
In a picking operation, first, the visual sensor is used for measuring positions and orientations of workpieces placed randomly or piled high. The operation of the robot arm is then corrected on the basis of information regarding the positions and orientations, and a robot hand (a gripper, an attraction pad, or the like) provided at an end of the robot arm approaches one of the workpieces from above and holds the workpiece.
A relationship between a coordinate system of the robot apparatus and a coordinate system of the visual sensor is usually obtained through calibration before the robot vision system begins to operate. This is because, in order to obtain operation target values of the robot apparatus from values obtained as a result of detection performed by the visual sensor, the values in the coordinate system of the visual sensor need to be transformed into values in the coordinate system of the robot apparatus, which are used for controlling the robot arm.
One of typical calibration methods in the related art is coordinate positioning through inching. The visual sensor detects three or more features such as workpieces or markers fixed in space, and, in order to realize positioning, an operator inches the robot arm such that coordinates of a representative point such as a tip of the robot arm match coordinates of each of the three or more features. Calibration values indicating a relationship between the coordinate system of the robot apparatus and the coordinate system of the visual sensor are then obtained from values obtained as a result of the detection performed by the visual sensor and positions and orientations of the robot arm achieved through the positioning.
A calibration method is also known in which a board including a marker for calibration is mounted at the end of the robot arm (for example, refer to Japanese Patent Laid-Open No. 2010-172986). In this method, the robot arm is positioned at a plurality of calibration positions and orientations, and the visual sensor is used for measuring coordinates of the marker with each of the plurality of calibration positions and orientations to calculate calibration values.
The coordinate positioning through inching in an example of the related art has a problem in that because the operator needs to finely adjust the position and orientation of the robot arm through inching, it takes time to complete the coordinate positioning compared to when automatized positioning is performed. In addition, the accuracy of positioning is not stable because the accuracy depends on skills of the operator.
Calibration jigs described in Japanese Patent Laid-Open No. 2010-172986 need to be made while a positional relationship between features (markers) thereof is carefully taken into consideration, or the positional relationship needs to be accurately understood after the calibration jigs are made. Either way, costs are undesirably high. In particular, if the robot vision system is used in a plurality of processes performed in a factory, jigs of appropriate sizes need to be used in accordance with the detection range of the visual sensor. That is, a plurality of accurate, expensive jigs need to be prepared, which is undesirable.
In the calibration method disclosed in Japanese Patent Laid-Open No. 2010-172986, in which a board including a marker for calibration is mounted at the end of the robot arm, it might be difficult for the visual sensor to detect the marker because the marker might hide behind the robot arm depending on the position and orientation of the robot arm. If a direction in which the visual sensor performs detection and a direction in which the robot arm approaches are substantially the same, for example, the marker might hide behind the robot arm. If the visual sensor arranged as described above detects the workpieces from above and the robot arm picks up one of the workpieces from above, the robot arm might obstruct the view of the visual sensor during the picking operation depending on the position and orientation of the robot arm. In this case, it is difficult for the visual sensor to detect the end of the robot arm.
The position and orientation of the robot arm during calibration therefore needs to be significantly different from those during an actual operation out of necessity so that the visual sensor can detect the marker at the end of the robot arm, or jigs need to be designed such that the position of the feature of the marker is located far from the end of the robot arm. If the position and orientation of the robot arm or the position of the feature of the marker to be detected by the visual sensor is significantly different from the position and orientation of the robot apparatus or the position of the feature of the marker during the actual operation, however, errors in the operation of the robot arm and errors in the detection performed by the visual sensor become large, thereby decreasing the accuracy of calibration. Because the accuracy of an absolute position of a robot arm is generally lower than the reproducibility of the position of the robot apparatus, calibration can be performed while the robot arm is operated to achieve positions and orientations close to those during the actual operation and cover a range in which the robot arm is movable during the actual operation as much as possible.
The present invention provides a robot apparatus capable of, without fine adjustment performed by the operator, accurately calibrating the coordinate system of the robot apparatus and the coordinate system of the visual sensor even with inaccurate jigs. The present invention also provides a robot vision system capable of performing accurate calibration without being affected by a hidden marker even if the direction in which the visual sensor performs detection and the direction in which the robot hand approaches are substantially the same.